﻿using System;
using System.Data;
using System.Configuration;
using System.Xml;
using System.Web;
using System.Collections.Specialized;
using SyCODE.Component.DataFactory;

namespace SyCODE.Blog.Updater
{
    /// <summary>
    /// 主题设置类
    /// </summary>
    public class Theme : Information
    {
        /// <summary>
        /// 主题设置类的构造函数
        /// </summary>
        /// <param name="bloger"></param>
        public Theme(string bloger)
            : base(bloger)
        {            
        }

        /// <summary>
        /// 设置主题
        /// </summary>
        /// <param name="theme">主题名称</param>
        /// <param name="skin">皮肤</param>
        public void Set(string theme,string skin)
        {
            XmlProcessingInstruction authorElement = (XmlProcessingInstruction)UserDocument.FirstChild.NextSibling;
            authorElement.Value = @"type=""text/xsl"" href=""/ui/theme/" + theme + @"/main.xsl""";
            UserDocument.DocumentElement.Attributes["theme"].Value = theme;
            UserDocument.DocumentElement.Attributes["skin"].Value = skin;
        }
    }

}